package com.study.studyInstance;

public class TestInstanceof {
    public static void main(String[] args) {
        Person p = new Person();
        Graduate g = new Graduate();
        Proffessor pro = new Proffessor();
        System.out.println(g instanceof Person);
        System.out.println( pro instanceof Graduate);
        System.out.println( pro instanceof Person);
    }
}
class Person{
    private String name;
    private int weight;
    private int lenght;
    private int age;
    public Person(){}
    public Person(String name){
        this.name = name;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getWeight() {
        return weight;
    }
    public void setWeight(int weight) {
        this.weight = weight;
    }
    public int getLenght() {
        return lenght;
    }
    public void setLenght(int lenght) {
        this.lenght = lenght;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
}
class Graduate extends Person{
    private String major;

    public String getMajor() {
        return major;
    }
    public void setMajor(String major) {
        this.major = major;
    }
}
class Proffessor extends Graduate{
    private String professionaltitles;
    public String getProfessionaltitles() {
        return professionaltitles;
    }
    public void setProfessionaltitles(String professionaltitles) {
        this.professionaltitles = professionaltitles;
    }
}
